// 鼠标滑过事件
// eslint-disable-next-line node/no-missing-require
const vscode = require('vscode');
const { KEY_REG } = require('./defineConst');

const hoverIns = vscode.languages.registerHoverProvider([
    { language: 'vue', scheme: '*' },
    { language: 'javascript', scheme: '*' },
    { language: 'typescript', scheme: '*' }
], {
    provideHover(document, position) {
        // do something
        const range = document.getWordRangeAtPosition(position, KEY_REG);
        const text = document.getText(range);
        console.log(range);
        if (range) {
            console.log(text);
            console.log(position);
            return new vscode.Hover('99999999');
        }
    }
});

module.exports = hoverIns;